<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>影视直播厅</title>
</head>
<body>
<h1 align="center">欢迎进入电影网站首页</h1>
<div sec:authorize="isAnonymous()">
	<h2 align="center">游客您好，如果想查看电影<a th:href="@{/userLogin}">请登录</a></h2>
</div>
<div sec:authorize="isAuthenticated()">
	<h2 align="center"><span sec:authentication="name" style="color: #007bff"></span>您好，您的用户权限为<span sec:authentication="principal.authorities" style="color:darkkhaki"></span>，您有权观看以下电影</h2>
	<form th:action="@{/mylogout}" method="post">
		<input th:type="submit" th:value="注销" />
	</form>
</div>
<hr>
<div sec:authorize="hasRole('common')">
	<h3>普通电影</h3>
	<ul>
		<li><a th:href="@{/detail/common/1}">我不是药神</a></li>
		<li><a th:href="@{/detail/common/2}">夏洛特烦恼</a></li>
	</ul>
</div>
<div sec:authorize="hasAuthority('ROLE_vip')">
	<h3>VIP专享</h3>
	<ul>
		<li><a th:href="@{/detail/vip/1}">速度与激情</a></li>
		<li><a th:href="@{/detail/vip/2}">猩球崛起</a></li>
	</ul>
</div>
</body>
</html>

